home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
ARASAN_S.ZIP
/
BOOKREAD.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-19
|
995b
|
51 lines
// Copyright 1992 by Jon Dart. All Rights Reserved.
#ifndef _BOOK_READER_H
#define _BOOK_READER_H
#include "bookentr.h"
#include "board.h"
#include <windows.h>
class Book_Reader
{
// provides read-only access to the opening book.
public:
Book_Reader(const char * const filename);
// opens book file
~Book_Reader();
// closes book file
const Boolean Is_Open() const
{
return is_open;
}
const unsigned Size() const
// Return number of half-moves in the book.
{
return my_size;
}
const unsigned Head( const Board &b);
// returns an index to the head of the hash chain for the
// board position.
void Fetch( const uint16 n, Book_Entry &book_entry );
// Fetches the nth book entry from the file.
// NOTE: n must satisfy: 0 <= n < Size(). Reads
// need not be sequential.
protected:
HWND hBook;
Boolean is_open;
unsigned my_size, my_hash_size;
};
#endif